package com.wzh.org.graphics

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View.SYSTEM_UI_FLAG_FULLSCREEN
import android.view.ViewGroup
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout

class MainActivity : AppCompatActivity() {
    //private lateinit var constraintLayout: ConstraintLayout

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        var nodeRoot = OrgTreeNode()
        nodeRoot.name = "王富贵"
        nodeRoot.roleName = "老板"
        nodeRoot.children = mutableListOf()

        var cNode01 = OrgTreeNode()
        cNode01.name = "李富国"
        cNode01.roleName = "司机"
        cNode01.children = mutableListOf()
        nodeRoot.children?.add(cNode01)

        var cNode0101 = OrgTreeNode()
        cNode0101.name = "赵强军"
        cNode0101.roleName = "司机"
        cNode01.children?.add(cNode0101)

        var cNode02 = OrgTreeNode()
        cNode02.name = "孙富强"
        cNode02.roleName = "司机"
        nodeRoot.children?.add(cNode02)

        var leftNode = OrgTreeNode()
        leftNode.name = "左青龙"
        leftNode.roleName = "助理"
        leftNode.children = mutableListOf()
        nodeRoot.leftTreeNode = leftNode

        var leftCNode01 = OrgTreeNode()
        leftCNode01.name = "老鼠"
        leftCNode01.roleName = "laoshu"
        leftNode.children?.add(leftCNode01)

        var leftCNode02 = OrgTreeNode()
        leftCNode02.name = "耗子"
        leftCNode02.roleName = "haozi"
        leftNode.children?.add(leftCNode02)

        var rightNode = OrgTreeNode()
        rightNode.name = "右白虎"
        rightNode.roleName = "助理"
        rightNode.children = mutableListOf()

        var rightCNode01 = OrgTreeNode()
        rightCNode01.name = "小猫"
        rightCNode01.roleName = "miao"
        rightNode.children!!.add(rightCNode01)

        var rightCNode02 = OrgTreeNode()
        rightCNode02.name = "小狗"
        rightCNode02.roleName = "gou"
        rightNode.children!!.add(rightCNode02)

        nodeRoot.rightTreeNode = rightNode


        var orgTreeView = OrgTreeView(this,nodeRoot)
        setContentView(orgTreeView)
    }


}